using System.Collections.Generic;
using UnityEngine;

public static class ListUtils
{
	public static void ClearAndDestroy<T>(this List<T> list) where T : MonoBehaviour
	{
		foreach (T item in list)
		{
			T current = item;
			UnityEngine.Object.Destroy(current.gameObject);
		}
		list.Clear();
	}
}
